import React, { Component } from 'react'
import { connect } from 'react-redux'
import { global as globalDuck } from 'ducks'
import Info from './userInfo'
import Chart from './chart'

class HomePage extends Component {
  componentDidMount = () => {
    const { actionSetActiveNavItem } = this.props
    actionSetActiveNavItem('home')
  }

  render() {
    return (
      <React.Fragment>
        <Info />
        <Chart />
      </React.Fragment>
    )
  }
}

const mapDispatchToProps = {
  actionSetActiveNavItem: globalDuck.creators.actionSetActiveNavItem,
}

export default connect(
  null,
  mapDispatchToProps,
)(HomePage)
